<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "cargo");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>

	
<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
	<div class="detailed-navbar-content panel-body">
		<t:form modelAttribute="standardUser" action="/cargo/standardUser/save" method="post" cssClass="form-horizontal">
			<div class="hide">
				 <t:hidden path="standardUserId"/>
 				 <t:hidden path="deleteMark"/>	
 				 <t:hidden path="createUserName"/>
		 		 <t:hidden path="createUserId"/>
		 		 <t:hidden path="createDate"/>
		 		 <t:hidden path="shopId"/>
		 		 <t:hidden path="cargoId" value='${t_cargoId}'/>
		 		 <input type="hidden" value='${standardsJson}' id=standardsJson  />
		 		 <input type="hidden" value='${standardPropertiesJson}' id=standardPropertiesJson  />
			</div>
 
			<table class="cntable table table-bordered  " style="margin-top:10px">	
				<thead>
					<tr class="success" >
						<th style="width:50px">编号</th>
						<c:forEach var="standardUserEdit" items="${standardUsers}" varStatus="status">
			    			<th style="width:50px">${standardUserEdit.standard.standardName}</th>
						</c:forEach>
						<th style="width:50px">成本价</th>
						<th style="width:50px">销售价</th>
					</tr>
				</thead>
				<tbody >
				
					<tr>
						<td>
							<input id="cargoNo" name="collocationNo"  value=""type="text" class="form-control " placeholder="请输入">
						</td>
				
						<c:forEach var="standardUserEdit" items="${standardUsers}" varStatus="status">			
							<td>
								<label class="cargoNo" style="display:none">${standardUserEdit.cargoNo }</label>
								<input name="otherPropertyNames"  value="" onchange=sumMoney(this)  type="text" class="form-control " placeholder="请输入">
								<input style="display:none"  type="text" value="${standardUserEdit.standardUserId }" name="standardUserIds" class="standardUserId" >
							</td>
						</c:forEach>	
						<td>
							<input   value="0" name="costPrice"   type="number" class="form-control costPrice " placeholder="请输入">
						</td>
						<td>
							<input   value="0" name="salePrice"   type="number" class="form-control salePrice " placeholder="请输入">
						</td>
					</tr>
				</tbody>
			</table>     
			<div class="col-md-12 col-sm-12"  id="addProduct" ></div>
		</t:form>
	</div>
	<t:panelFoot headingBtnCssClass="heading-btn pull-right-important">
		<t:button icon="icon-floppy-disk" onclick="saveData()" laddaType="progress" cssClass="btn-info" csize="sm">保存</t:button>
	</t:panelFoot>
</t:panel>

<script type="text/javascript">

$(function(){	
	randomNumber();
	
}); 

function randomNumber(){
	const now =new Date();	
	var  month=now.getMonth()+1;
	var day=now.getDate();
	var hour=now.getHours();
	var minutes=now.getMinutes();
	var seconds=now.getSeconds();
   
    
    var collocationNo=$("label:first").text()
    
	$("#cargoNo").val(collocationNo + (Math.round(Math.random() * 89 + 100)).toString());
	
}


function saveData(lBtn){
	if (!$("form:first").valid()){
		return;
	}
	lBtn.start();
	$("form:first").submit();
}



</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/ui/prism.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/forminputs.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
